<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<style>
			#d2{
				height: 600px;
				width: 660px;
				/*border: 10px dotted red;*/
				border-width: 10px;
				border-style: dotted;
				border-color: red;
			}
		</style>
		<script>
			function showDiv()
			{
				var d=document.getElementById("d2");
				//只支持行内样式
				//alert(d.style.height);
				//alert(d.style.border);
				/**var st=document.defaultView.getComputedStyle(d,null);
				alert("height:"+st.height+",边框："+st.borderWidth);
				alert("边框："+d.currentStyle.borderWidth);**/
				//window.navigator.app
				
				var st=d.currentStyle||document.defaultView.getComputedStyle(d,null);
				alert("height:"+st.height+",边框："+st.borderLeftWidth);
			}
		</script>
	</head>
	<body>
		<div id="d1" style="height: 400px; width: 400px; border: 10px groove blue;">
			we change lives!
		</div>
		<div id="d2"  >
			we change lives!
		</div>
		<input type="button" value="show div" onclick="showDiv()"/>
	</body>
</html>
